//
//  HWEveryDayTaskHeader.swift
//  HWanGame
//
//  Created by 王昌健 on 2022/6/21.
//  Copyright © 2022 94hwan. All rights reserved.
//

import UIKit

class HWEveryDayTaskHeader: UITableViewHeaderFooterView {
    var titleLabel:UILabel!
    class func headerOrFooterWithTableView(tableView:UITableView) -> (HWEveryDayTaskHeader) {
        let reUse:String = "HWEveryDayTaskHeader"
        
        var headerOrFooter = tableView.dequeueReusableHeaderFooterView(withIdentifier: reUse)
        
        if headerOrFooter == nil {
            headerOrFooter = HWEveryDayTaskHeader.init(reuseIdentifier: reUse)
        }
        
        return headerOrFooter as! HWEveryDayTaskHeader
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        initUI()
        initFrame()
    }
    
    
    func initUI() -> Void {
        backgroundView = UIView()
        
        titleLabel = HWLabel.createBoldLabel(title: "新用户任务", color: "#333333", font: 14*widthScale)
        contentView.addSubview(titleLabel)
    }
    
    func initFrame() -> Void {
        titleLabel.snp.makeConstraints { make in
            make.height.equalTo(20*widthScale)
            make.bottom.equalToSuperview()
            make.left.equalTo(14*widthScale)
        }
    }
}
